package coupon;

import com.atguigu.gulimall.coupon.entity.SeckillSessionEntity;
import org.junit.Test;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.util.List;

public class Demo {

    public List<SeckillSessionEntity> getLatest3DaySession() {
        String start = getStartTime();
        String end = getEndTime();

        System.out.println(start);
        System.out.println(end);

        return null;
    }

    public String getStartTime() {
        LocalDate now = LocalDate.now();
        LocalTime min = LocalTime.MIN;

        return LocalDateTime.of(now, min).format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
    }

    public String getEndTime() {
        LocalDate now = LocalDate.now().plusDays(2);
        LocalTime max = LocalTime.MAX;

        return LocalDateTime.of(now, max).format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
    }

    @Test
    public void r1(){
        getLatest3DaySession();
    }
}
